﻿using Furion.CMS.Core.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Furion.CMS.Application
{
    public class DataDictionarySort : Core.Base.BaseSortParams
    {
        /// <summary>
        /// 创建时间
        /// </summary>
        public SortMode? CreatedTime { get; set; }
        /// <summary>
        /// 排序号
        /// </summary>
        public SortMode? SortNumber { get; set; }

        public override SortInfo GetSort()
        {
            SortInfo result = default;
            if (CreatedTime.HasValue)
            {
                result = new SortInfo { Field = nameof(CreatedTime), Mode = CreatedTime.Value };
            }
            else if (SortNumber.HasValue)
            {
                result = new SortInfo { Field = nameof(SortNumber), Mode = SortNumber.Value };
            }
            return result;
        }
    }
}
